<template>
  <CardMode
    class="facilities"
    title="房屋设施"
    v-if="hotel.checkedItems && hotel.checkedItems.length"
  >
    <div class="content">
      <div class="facilities" v-for="(item, index) in hotel.checkedItems" :key="index">
        <div class="name">{{ item.name }}</div>
        <div class="list">
          <div class="item" v-for="(item2, index2) in item.markersItem" :key="index2">
            <wd-icon
              v-if="item2.checked"
              name="check-outline"
              size="34rpx"
              color="#07C160"
            ></wd-icon>
            <wd-icon v-else name="close-outline" size="34rpx" color="#FF5940"></wd-icon>
            {{ item2.name }}
          </div>
        </div>
      </div>
    </div>
  </CardMode>
</template>
<script setup lang="ts">
defineOptions({ name: 'Facilities' })

defineProps(['hotel'])
</script>
<style lang="scss" scoped>
.facilities {
  :deep(.card-content) {
    padding: 0 30rpx;
  }
}
.content {
  .facilities {
    display: flex;
    @include border-bottom(#e6ecf0);
    padding: 15rpx 0;
    &:first-child {
      padding-top: 0;
    }
    &:last-child {
      @include border-bottom(transparent);
    }
    .name {
      width: 120rpx;
      padding: 15rpx 0;
      font-size: 27rpx;
      font-weight: 600;
      color: var(--color1) 0;
    }
    .list {
      display: grid;
      flex: 1;
      grid-template-columns: 1fr 1fr 1fr;
      width: 0;
      .item {
        display: flex;
        padding: 15rpx 0;
        font-size: 23rpx;
        color: var(--color4);
        :deep(.wd-icon) {
          margin-right: 6rpx;
        }
      }
    }
  }
}
</style>
